/**
 * EventCreatorPanel.java
 * @author pkendzo
 * Email: pkendzo@msn.com
 * 2012
 */
package lu.med.praxiswahl.wahlumed.client.cashbook;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 * @author pkendzo
 * 
 */
public class EventCreatorPanel extends JFrame implements ActionListener
{

    /**
     * 
     */
    private static final long serialVersionUID = 5386704992846071196L;

    private JLabel date;
    private JLabel event;
    private JLabel revenue;
    private JLabel spending;

    private JTextField dateField;
    private JTextField eventField;
    private JTextField revenueField;
    private JTextField spendingField;

    private JButton okButton, cancelButton;

    private JPanel mainPanel;

    public EventCreatorPanel()
    {

	super("Neuer Vorgang");
	this.setLayout(new BorderLayout());
	this.setDefaultCloseOperation(EXIT_ON_CLOSE);

	this.mainPanel = new JPanel();
	this.mainPanel.setLayout(null);
	this.mainPanel.setBounds(0, 70, 300, 300);

	date = new JLabel("Datum");
	this.date.setBounds(5, 10, 120, 20);

	this.event = new JLabel("Vorgang");
	this.event.setBounds(5, 50, 120, 20);

	this.revenue = new JLabel("Einnahme");
	this.revenue.setBounds(5, 90, 120, 20);

	this.spending = new JLabel("Ausgabe");
	this.spending.setBounds(5, 130, 120, 20);

	this.dateField = new JTextField();
	this.dateField.setBounds(130, 10, 100, 20);

	this.eventField = new JTextField();
	this.eventField.setBounds(130, 50, 100, 20);

	this.revenueField = new JTextField();
	this.revenueField.setBounds(130, 90, 100, 20);

	this.spendingField = new JTextField();
	this.spendingField.setBounds(130, 130, 100, 20);

	this.mainPanel.add(this.date);
	this.add(this.dateField);

	this.mainPanel.add(this.event);
	this.mainPanel.add(this.eventField);

	this.mainPanel.add(this.revenue);
	this.mainPanel.add(this.revenueField);

	this.mainPanel.add(this.spending);
	this.mainPanel.add(this.spendingField);

	this.okButton = new JButton("OK");
	this.okButton.setBounds(30, 200, 100, 20);
	this.add(this.okButton);

	this.cancelButton = new JButton("ABBRECHEN");
	this.cancelButton.setBounds(150, 200, 120, 20);
	this.mainPanel.add(this.cancelButton);

	this.add(this.mainPanel, BorderLayout.CENTER);

	this.setSize(500, 500);
	this.setLocation(300, 400);
	this.setAlwaysOnTop(true);
	this.pack();
	this.setVisible(true);

    }

    public static void main(String[] args)
    {
	new EventCreatorPanel();
    }

    @Override
    public void actionPerformed(ActionEvent e)
    {
	if (e.getActionCommand() == "OK")
	{

	}
	else if (e.getActionCommand() == "ABBRECHEN")
	{
	    System.exit(0);
	}

    }

}
